<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'index.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">
    <meta name="author" content="Muhammad Usman">
<%@include file="/commons/commonJs.jsp"%>
<script type="text/javascript">
function toSubmit(){
	var flag1=myValidate('schoolName',true,'text',4,30);
	var flag2=myValidate('shortName',false,'text',4,30);
	var flag3=myValidate('telNo',false,'tel');
	var flag4=myValidate('mobile',false,'mobile');
	var flag5=myValidate('address',false,'text',0,50);
	if(flag1&&flag2&&flag3&&flag4&&flag5){
		formSubmit('formSubmit');
	}
}
</script>
</head>

<body>

            <!-- content starts -->
                <div>
        <ul class="breadcrumb">
            <li>
                <a href="javascript:skipPage('<%=basePath%>mgt/login/content.do')">Home</a>
            </li>
            <li>
                <a href="javascript:skipPage('<%=basePath%>mgt/school/schoolList.do')">校区管理</a>
            </li>
            <li>
              <c:if test="${school!=null }">
              	<a href="#">更新校区信息</a>
              </c:if>
              <c:if test="${school==null }">
              	<a href="#">新增校区信息</a>
              </c:if>
            </li>
        </ul>
    </div>

<form id="formSubmit"  role="form" 
<c:if test="${school==null }"> action="<%=basePath%>mgt/school/schoolSave.do" </c:if> 
<c:if test="${school!=null }"> action="<%=basePath%>mgt/school/schoolUpdate.do" </c:if>
 method="POST">

<div class="row">
        <div class="box col-md-12">
            <div class="box-inner">
                <div class="box-header well" data-original-title="">
                    <c:if test="${school!=null }">
		              	<h2>更新校区信息</h2>
		              </c:if>
		              <c:if test="${school==null }">
		              	<h2>新增校区信息</h2>
		              </c:if>
                    
                </div>
                <div class="box-content">
                <input type="hidden" id="id" name="id" value="${school.id }">
				 <fieldset>
                    <div class="form-group col-md-6">
	                    <label class="control-label" for="schoolName">校区名称</label><span id="sp_schoolName" ></span>
	                    <input type="text" class="form-control" name="schoolName" value="${school.schoolName }" id="schoolName" onblur="myValidate('schoolName',true,'text',4,30)">
	                </div>
	                <div class="form-group col-md-6">
	                    <label class="control-label" for="shortName">校区简称</label><span id="sp_shortName" ></span>
	                    <input type="text" class="form-control" name="shortName" value="${school.shortName }" id="shortName" onblur="myValidate('shortName',false,'text',4,30)">
	                </div>
	                <div class="form-group col-md-6">
	                    <label class="control-label" for="telNo">校区电话</label><span id="sp_telNo" ></span>
	                    <input type="text" class="form-control" name="telNo" value="${school.telNo }" id="telNo" onblur="myValidate('telNo',false,'tel')">
	                </div>
	                <div class="form-group col-md-6">
	                    <label class="control-label" for="mobile">校区手机</label><span id="sp_mobile" ></span>
	                    <input type="text" class="form-control" name="mobile" value="${school.mobile }" id="mobile" onblur="myValidate('mobile',false,'mobile')">
	                </div>
				  	<div class="form-group col-md-12">
	                    <label class="control-label" for="address">校区地址</label><span id="sp_address" ></span>
	                    <input type="text" class="form-control" name="address" value="${school.address }" id="address" onblur="myValidate('address',false,'text',0,50)">
	                </div>
				  	
					
					
					
				  	<div class="form-group col-md-12">
						<button type="button" class="btn btn-primary" onclick="toSubmit();">保存</button>
						<button type="reset" class="btn">重置</button>
				  	</div>
				</fieldset>                    
                </div>
            </div>
        </div>
    </div><!--/span-->

</form>

    <!-- content ends -->


</body>
</html>
